package com.weixing.mall.base.constant;

/**
 * 全局常量类
 *
 * @author  siashan
 * @since v1.0
 */
public class GlobalConstant {


    //    默认分页大小
    public static int DEFAULT_PAGE_SIZE = 10;

    //配置文件根前缀
    public static final String ROOT_PREFIX_PROPERTY = "weixing";
    // security配置文件前缀
    public static final String SECURITY_PREFIX_PROPERTY = "weixing.security";
    // Mapper文件包扫描跟路径
    public static final String MAPPER_SCAN_PREFIX = "com.weixing.mall.provider.mapper";

    public static final String MH = ":";

    // 正则相关常量
    public static final String REGEX_MOBILE = "^[1][0,1,2,3,4,5,6,7,8,9][0-9]{9}$";
    public static final String REGEX_PASSWORD = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$";

    // Redis前缀相关

    /**
     * 短信验证码前缀
     */
    public static final String REDIS_PRE_SMS = "SMS_";
    /**
     * 图形验证码前缀
     */
    public static final String REDIS_PRE_CODE = "CODE_";
    /**
     * 防重复提交前缀
     */
    public static final String REDIS_PRE_NOREPEAT = "NOREPEAT_";
    /**
     * IP短信发送频率限制
     */
    public static final String REDIS_PRE_IP_MSG_LIMIT = "IP_MSG_LIMIT_";

    // http request请求相关
    public static final String UNKNOWN = "unknown";
    public static final String X_FORWARDED_FOR = "X-Forwarded-For";
    public static final String X_REAL_IP = "X-Real-IP";
    public static final String PROXY_CLIENT_IP = "Proxy-Client-IP";
    public static final String WL_PROXY_CLIENT_IP = "WL-Proxy-Client-IP";
    public static final String HTTP_CLIENT_IP = "HTTP_CLIENT_IP";
    public static final String HTTP_X_FORWARDED_FOR = "HTTP_X_FORWARDED_FOR";
    public static final String LOCALHOST_IP = "127.0.0.1";
    public static final String LOCALHOST_IP_16 = "0:0:0:0:0:0:0:1";
    public static final int MAX_IP_LENGTH = 15;
    // 认证相关
    public static final String BASIC_AUTH = "Basic ";
    public static final String BEARER_TOKEN = "Bearer ";


    /**
     * 符号相关
     */
    public static class symbol {
        /**
         * 逗号
         */
        public static final String COMMA = ",";
        /**
         * 点
         */
        public static final String SPOT = ".";
        /**
         * 下划线
         */
        public final static String UNDER_LINE = "_";
        /**
         * 百分号
         */
        public final static String PER_CENT = "%";
        /**
         * 符号 "@"
         */
        public final static String AT = "@";
        /**
         * 双竖线
         */
        public final static String PIPE = "||";
        /**
         * 单竖线
         */
        public final static String SINGLE_VERTICAL_LINE = "|";
        public final static String SHORT_LINE = "-";
        public final static String SPACE = " ";
        public static final String SLASH = "/";
        /**
         * 冒号
         */
        public static final String MH = ":";

    }


    /**
     * 请求字段相关
     */
    public static final String FIELD_SIGN = "sign";
    public static final String FIELD_TIMESTAMP = "timestamp";
    // 图形验证码标识
    public static final String FIELD_UTOKEN = "utoken";
    // 服务间传递用户id
    public static final String X_HEADER_UID = "X-Header-Uid";
    public static final String X_HEADER_UNAME = "X-Header-Uname";
    public static final String X_HEADER_AUTHBIZ = "X-Header-AuthBiz";
    public static final String X_HEADER_UR = "X-Header-Ur";
    public static final String X_HEADER_UK = "X-Header-Uk";

    /**
     * 加密方式
     */
    public static final String SIGN_TYPE_MD5 = "MD5";
    public static final String SIGN_TYPE_HMACSHA256 = "HMACSHA256";

    /**
     * 字符集编码
     */
    public static final String CHARSET_UTF8 = "UTF-8";


    public static final String SUCCESS = "SUCCESS";
    public static final String FAIL = "FAIL";


    /**
     * 用户角色
     */
    public static class UserRole {
        public static final String AGENT = "r1";  // 代理商
        public static final String MEMBER = "r2"; // 会员
        public static final String SYS = "r3";  // 管理员
    }

    public static class RoleCode {
        public static final String FFBZG = "fhbzg";
        public static final String APPZG = "appgly";
        public static final String ADMIN = "admin";
        public static final String DIRECTOR = "director";//广告专员
        public static final String KF = "customer";//客服
        public static final String KFADMIN = "customerInCharge";//客服主管
        public  static  final  String SHIPPING="shippingClerk";//发货员
        public  static  final String APPYG="appyg";

    }

    /*
     * 仓库编码
     * */
    public static class DepotCode {
        public static final String ERP = "ERP";
        public static final String OUT = "OUT";
        public static final String APP = "APP";
        public static final String FHB = "FHB";
        public static final String CP = "CP";
    }

    /**
     * ThrealLocalMap Key
     */
    public static final String TLMK_USER_AUTH_DTO = "USER_AUTH_DTO";
    public static final String TLMK_SMS_FREQUENCY = "sms_Frequency";

    //发货部可以执行的订单类型 1代表正价订单，2代表活动订单，3点代理商活动订单
    public static final Long[] SHIPPER_TYPE = new Long[]{1L, 3L};

    public static final Long[] APP_TYPE = new Long[]{2L};//APP仓库可以执行的订单类型

    public static final Long SHIPPER_ID = 2L;//发货部仓库ID

    public static final Long APP_ID = 1L;//APP仓库ID

    public static final Long ERP_ID = 3L;//ERP仓库ID

    public static final String PUBLIC_POOL_DAY = "public_pool_time";

    public static final String PUBLIC_POOL_WAIT = "public_pool_wait";


    // 订单类型前缀

    /**
     * 正价订单
     */
    public static final String ORDER_PRE_ZJ = "ZJ";

    /**
     * 秒杀活动订单
     */
    public static final String ORDER_PRE_MS = "MS";
    /**
     * 代理商活动订单
     */
    public static final String ORDER_PRE_DL = "DL";

    /**
     * 订单货物标识
     */
    public static final String ORDER_GOODS_TAG = "HPBS";

    /**
     *自动确认订单收货天数
     */
    public static int AUTO_CONFIRM_ORDER_DAY = 180;

    /**
     * 积分奖励CODE
     */
    public static final String REG_POINT = "REG_POINT";//注册
    public static final String BUY_POINT = "BUY_POINT";//下单
    public static final String SHOW_POINT = "SHOW_POINT";//买家秀


    // ******************** 代理获利归属类型***************************


    /**
     * 个人订单
     */
    public static final int PROFIT_BELONG_TYPE_OWN = 1;
    /**
     * 团队订单
     */
    public static final int PROFIT_BELONG_TYPE_GROUP = 2;
    /**
     * 合伙人订单
     */
    public static final int PROFIT_BELONG_TYPE_PARTNER = 3;

    // ******************** 代理获利类型***************************
    /**
     * 返利
     */
    public static final int PROFIT_TYPE_REBATE = 1;
    /**
     * 佣金
     */
    public static final int PROFIT_TYPE_COMM = 2;
    /**
     * 分红
     */
    public static final int PROFIT_TYPE_BONUS = 3;

    /**
     * 客服
     */
    public static final int PROFIT_TYPE_KEFU = 0;


    // ******************** 上交人角色***************************
    /**
     * 会员
     */
    public static final int PAYERROLE_MEMBER = 1;
    /**
     * 代理
     */
    public static final int PAYERROLE_AGENT = 2;

    // ******************** 收款人角色***************************
    /**
     * 代理
     */
    public static final int RECEIVORROLE_AGENT = 2;
    /**
     * 客服
     */
    public static final int RECEIVORROLE_KEFU = 1;

    // ******************** 分红类型***************************
    /**
     * 一级分红
     */
    public static final int BONUS_LEVEL1 = 1;
    /**
     * 二级分红
     */
    public static final int BONUS_LEVEL2 = 2;

    //**********************代理上交款状态*****************
    /**
     * 未上交
     */
    public static final int PROFIT_SETTLE_STATE_NOTUP = 0;
    /**
     * 待上交
     */
    public static final int PROFIT_SETTLE_STATE_NEEDUP = 1;
    /**
     * 已上交
     */
    public static final int PROFIT_SETTLE_STATE_HASUP = 2;


    /**
     * 图片访问域名
     */
    public static final String IMG_PATH_URL = "http://lmpic.weixingshishang.cn/";

    /**
     * 压缩图片访问后缀
     */
    public static final String IMG_PATH_URL_SUFFIX = "?x-oss-process=style/pics_style";

    /**
     * ERP出库仓库ID参数
     */
    public static final String ERP_DEPOT_ID = "1001";

    /**
     * ERP出库供应商参数
     */
    public static final String ERP_SUPPLIER_ID = "G9999";
    /**
     * 一次批量提交的数量
     */
    public  static  final int BATCH_SIZE=100;
    /**
     * 活动编码正价为P
     */
    public  static  final  String ACT_CODE="P";


}
